package com.zsy.utils;

/**
 * @author: zhengsuyang
 * @Desc: 工具类获取操作人姓名
 * @create: 2025-09-14 20:10
 **/

public class CurrentHolder {
    //  线程本地变量 用来保存当前操作人的id
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
    public static void setCurrentUserId(Integer id){
        threadLocal.set(id);
    }
    public static Integer getCurrentUserId(){
        return threadLocal.get();
    }
    public static void remove(){
        threadLocal.remove();
    }
}
